/* Copyright 2001,2002,2003 NAH6
 * All Rights Reserved
 *
 * Parts Copyright DoD, Parts Copyright Starium
 *
 */
/*LINTLIBRARY*/
/*PROTOLIB1*/

/**************************************************************************
*                                                                         *
* INCLUDE FILE
*               FILTER.h
*
* FUNCTION
*               FILTER structure
*
***************************************************************************
*
*
*
*
**************************************************************************/

#define MAXORDER        16              /* maximum filter order          */

typedef struct
{       int order, data_length;
        fxpt_32 memory[MAXORDER+1];
        fxpt_16 coef[MAXORDER+1];
} FILTER;

typedef struct
{       int order, data_length;
        fxpt_32 memory[MAXORDER+1];
        fxpt_32 coef[MAXORDER+1];
} BIGFILTER;

/*  Function prototypes */

/* -------------- do_pfilt.c -------------- */
void do_pfilt(
BIGFILTER *flt,
fxpt_32 indata[],
fxpt_16 data[]);

void do_pfilt_dynamic(
FILTER  *flt,
fxpt_16 coef[],
fxpt_16 data[]);

void do_pfilt_dynamic32to16(
FILTER  *flt,
fxpt_16 coef[],
fxpt_32 indata[],
fxpt_16 outdata[]);

/* -------------- do_zfilt.c -------------- */
void do_zfilt(
BIGFILTER *flt,
fxpt_16 indata[],
fxpt_32 outdata[]);

void do_zfilt_dynamic(
FILTER  *flt,
fxpt_16 coef[],
fxpt_16 data[]);

void do_zfilt_dynamic16to32(
FILTER  *flt,
fxpt_16 coef[],
fxpt_16 indata[],
fxpt_32 outdata[]);

void do_zfilt_dynamic32to32(
FILTER  *flt,
fxpt_16 coef[],
fxpt_32 data[]);

/* -------------- filters.c -------------- */
void do_zpfilt_dynamic(
FILTER *zflt,
FILTER *pflt,
fxpt_16 zcoef[],
fxpt_16 pcoef[],
fxpt_16 data[]);

void do_zpfilt_dynamic32to16(
FILTER *zflt,
FILTER *pflt,
fxpt_16 zcoef[],
fxpt_16 pcoef[],
fxpt_32 indata[],
fxpt_16 outdata[]);

void HPF_InSpeech(
fxpt_16 speech[F_LEN]);

void HPF_OutSpeech(
fxpt_16 speech_in[SF_LEN],
fxpt_16 speech_out[SF_LEN]);

void FilterImpulseResponse(
fxpt_16 h[SF_LEN],
fxpt_16 coef[ORDER+1]);

/* -------------- makefilt.c -------------- */
FILTER makefilt(
fxpt_16 coef[],
int     f_order,
int     data_length);

BIGFILTER makebigfilt(
fxpt_32 coef[],
int     f_order,
int     data_length);

FILTER makefilt_dynamic(
int     f_order,
int     data_length);
